<template>
	<view>
		<view class="list" v-for="(item,index) in list">
			<view class="box">
				<image :src="url+item.user.avatar" mode="aspectFill"></image>
				<view class="detail">
					<view class="name">{{item.user.nickname}}</view>
					<view class="time">{{item.paymenttime}}</view>
				</view>
			</view>
			<view class="money">+{{item.price}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				date: '',
				page: 1,
				list: [],
				url: getApp().globalData.baseurl,
			}
		},
		onLoad(e) {
			this.date = e.date
			this.getData();
		},
		methods: {
			getData() {
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				uni.request({
					url: this.url + '/api/shop.Shop/income_record_info',
					method: "POST",
					data: {
						date: this.date,
						page: this.page
					},
					header: {
						'token': uni.getStorageSync('wanlshop:user').token,
					},
					success: (res) => {
						uni.hideLoading();
						console.log(res.data);
						this.list = this.list.concat(res.data.data)
					}
				})
			},
		},
		onReachBottom() {
			this.page += 1;
			this.getData();
		},
	}
</script>

<style lang="scss">
	.list {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 690rpx;
		height: 160rpx;
		background-color: #fff;
		border-radius: 16rpx;
		margin-top: 30rpx;
		margin-left: 30rpx;

		.box {
			display: flex;
			align-items: center;
			margin-left: 30rpx;

			image {
				width: 90rpx;
				height: 90rpx;
				border-radius: 50%;
				border: 2px solid #03BD61;
			}

			.detail {
				margin-left: 26rpx;

				.name {
					font-size: 30rpx;
					color: #3D3D3D;
				}

				.time {
					font-size: 26rpx;
					color: #999999;
					margin-top: 10rpx;
				}
			}
		}

		.money {
			font-size: 36rpx;
			color: #03BD61;
			margin-right: 30rpx;
		}
	}
</style>